home *** CD-ROM | disk | FTP | other *** search
/ Knitting Made Easy / Knitting.iso / App / Patterns.dxr / behaviors_122_Click Play Pause.ls < prev    next >
Encoding:
Text File  |  2002-04-18  |  2.7 KB  |  83 lines

  1. property Action, WhichLabel, standardImage, alternateImage
  2.  
  3. on mouseDown me
  4.   emem = the memberNum of sprite clickOn()
  5.   set the memberNum of sprite clickOn() to emem + 1
  6.   updateStage()
  7.   repeat while the stillDown
  8.     if rollover(clickOn()) then
  9.       set the memberNum of sprite clickOn() to emem + 1
  10.     else
  11.       set the memberNum of sprite clickOn() to emem - 1
  12.     end if
  13.     updateStage()
  14.   end repeat
  15.   updateStage()
  16.   set the memberNum of sprite clickOn() to emem
  17.   updateStage()
  18.   if Action = "Go to marker" then
  19.     go(WhichLabel)
  20.   else
  21.     if Action = "Play marker" then
  22.       play frame WhichLabel
  23.     end if
  24.   end if
  25.   if sprite(20).mediaBusy then
  26.     set the member of sprite the spriteNum of me to member(32, 5)
  27.     videopause(sprite(20))
  28.   else
  29.     set the member of sprite the spriteNum of me to member(29, 5)
  30.     videoplay(sprite(20))
  31.   end if
  32. end
  33.  
  34. on beginSprite me
  35. end
  36.  
  37. on mouseWithin me
  38.   if sprite(20).mediaBusy then
  39.     set the member of sprite the spriteNum of me to member(29, 5)
  40.   else
  41.     set the member of sprite the spriteNum of me to member(32, 5)
  42.   end if
  43. end
  44.  
  45. on mouseEnter me
  46.   if sprite(20).mediaBusy then
  47.     set the member of sprite the spriteNum of me to member(29, 5)
  48.   else
  49.     set the member of sprite the spriteNum of me to member(32, 5)
  50.   end if
  51. end
  52.  
  53. on mouseLeave me
  54.   if sprite(20).mediaBusy then
  55.     set the member of sprite the spriteNum of me to member(28, 5)
  56.   else
  57.     set the member of sprite the spriteNum of me to member(31, 5)
  58.   end if
  59. end
  60.  
  61. on getPropertyDescriptionList
  62.   global ibcDefaultParams
  63.   if the currentSpriteNum = 0 then
  64.     memdefault = 0
  65.   else
  66.     memref = the member of sprite the currentSpriteNum
  67.     castLibNum = memref.castLibNum
  68.     memdefault = member(memref.memberNum + 1, castLibNum)
  69.   end if
  70.   if listp(ibcDefaultParams) then
  71.     return ibcDefaultParams
  72.   else
  73.     description = [:]
  74.     addProp(description, #Action, [#default: "None", #range: ["None", "Go to marker", "Play marker"], #format: #symbol, #comment: "MouseUp Action:"])
  75.     addProp(description, #WhichLabel, [#comment: "Destination Marker:", #format: #marker, #default: "next"])
  76.     return description
  77.   end if
  78. end
  79.  
  80. on getBehaviorDescription
  81.   return "- Click Behavior -" & RETURN & "Defined: controls a dual-image button." & RETURN & "Intended Use: to give user a simple audio + visual feedback that they've engaged a control. Rolling off button during mouseDown will disengage." & RETURN & RETURN & "- Properties -" & RETURN & "MouseUp Action: assigns a button course of action." & RETURN & "  (Note: Select 'None' if you plan to add a seperate mouseUp behavior to this button)" & RETURN & "Destination Marker: assigns a destination to the course of action." & RETURN & RETURN & "(Explore the 'LookHere' folder on the CD-Rom for examples of each behavior)"
  82. end
  83.